<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>轮播图</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
       <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css">
      <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js">
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmSliderController.do?doAdd" >
					<input id="id" name="id" type="hidden" value="${wmSliderPage.id }"/>
		<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
			
					           <tr>
                  <td align="right">
						<label class="Validform_label">
							图片:
						</label>
					</td>
					<td class="value">
						<div id="imgshow">
						</div>
						<input type="file" name="templatePic_u" id="templatePic_u" /></span>
                    	<input type="hidden" id="photo" name="photo" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">图片</label>
					</td>
					</tr>
						<tr>
					<td align="right">
						<label class="Validform_label">
							顺序:
						</label>
					</td>
					<td class="value">
					     	 <input id="sliderOrder" name="sliderOrder" type="text" style="width: 150px" class="inputxt"  datatype="n"  ignore="ignore" />
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">顺序</label>
						</td>
				</tr>
                    <tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							路径:
						</label>
					</td>
					<td class="value" >
						  	 <input type="text" id="sliderUrl" name="sliderUrl" class="inputxt"  datatype="n" ignore="ignore" ></input>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">路径</label>
						</td>
					</tr>
			</table>
		</t:formvalid>
		<script type="text/javascript">
	      function delPicture2(ths){
	          var t = $(ths).attr("value");
	          var path = $("#photo").val();
	          var vals = path.replace(","+t,"");
	          vals = vals.replace(t+",","");
	          vals = vals.replace(t,"");
	          $("#photo").val(vals);
	          $(ths).parent().remove();
	        } 
		$(function () {
	        $("#templatePic_u").uploadify({
	            buttonText:'浏览',
	            progressData:'speed',
	            multi:true,
	            height:25,
	            width:500,
	            overrideEvents:['onDialogClose'],
	            fileTypeDesc:'文件格式:',
	            fileTypeExts:'*.jpg;*,jpeg;*.png;*.gif;*.bmp;*.ico;*.tif',
	            fileSizeLimit:'15MB',
	            swf:'plug-in/uploadify/uploadify.swf',
	            uploader:'cgformTemplateController.do?uploadPicFor',
	            auto:true,
	            onUploadSuccess : function(file, data, response) {
	                if(data){
	                    var d=$.parseJSON(data);
	                    if(d.success){
	                      var srcp = "upload/"+d.obj;
	                      if($("#photo").val()!="" && $("#photo").val()!=undefined){
	                        $("#photo").val($("#photo").val()+","+srcp);
	                      }else{
	                        $("#photo").val(srcp);
	                      }
	                      $("#imgshow").append("<div><img src='"+srcp+"' width=\"50px;\"/><a href=\"javascript:void(0)\" class=\"jeecgDetail\" value='"+srcp+"' onclick=\"delPicture2(this);\">删除</a><br></div>");
	                    }
	                }

	            }
	        });
	    });
		</script>
 </body>
  <script src = "webpage/com/jeecg/gslider/wmSlider.js"></script>		
